package com.taobao.wolfwolf.hibernate.pojo;

/**
 * MaterialSizeId entity. @author MyEclipse Persistence Tools
 */

public class MaterialSizeId implements java.io.Serializable {

	// Fields

	private Material material;
	private Size size;

	// Constructors

	/** default constructor */
	public MaterialSizeId() {
	}

	/** full constructor */
	public MaterialSizeId(Material material, Size size) {
		this.material = material;
		this.size = size;
	}

	// Property accessors

	public Material getMaterial() {
		return this.material;
	}

	public void setMaterial(Material material) {
		this.material = material;
	}

	public Size getSize() {
		return this.size;
	}

	public void setSize(Size size) {
		this.size = size;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof MaterialSizeId))
			return false;
		MaterialSizeId castOther = (MaterialSizeId) other;

		return ((this.getMaterial() == castOther.getMaterial()) || (this
				.getMaterial() != null && castOther.getMaterial() != null && this
				.getMaterial().equals(castOther.getMaterial())))
				&& ((this.getSize() == castOther.getSize()) || (this.getSize() != null
						&& castOther.getSize() != null && this.getSize()
						.equals(castOther.getSize())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getMaterial() == null ? 0 : this.getMaterial().hashCode());
		result = 37 * result
				+ (getSize() == null ? 0 : this.getSize().hashCode());
		return result;
	}

}